<?php require VIEW_PATH."/header.php";?>
<body>
<script>
	var web = "{{__WEB__}}";
</script>
<script src="App/Admin/View/Product/js.js"></script>
<table border="1" width="100%">
	<tr>
		{{foreach from="$attr" value="$v"}}
			<td width="60">{{$v['attr_name']}}</td>
		{{endforeach}}
		<td width="180">货号</td>
		<td width="180">库存数量</td>
		<td width="80">操作</td>
	</tr>
	{{foreach from="$product" value="$p"}}
	<tr>
		{{foreach from="$p['attr']" value="$m"}}
		<td>
			{{$m}}
		</td>
		{{endforeach}}
		<td width="180">
			<input type="text" name="product_sn[]" value="{{$p['product_sn']}}">
		</td>
		<td width="180">
			<input onchange="changeProductNumber(this,{{$p['product_id']}})" type="number" name="product_number[]" value="{{$p['product_number']}}">
		</td>
		<td>
			<a href="javascript:;" onclick="removeProduct(this)">[-]</a>
		</td>
	</tr>
	{{endforeach}}
</table>
	<form action="" method="post">
	<input type="hidden" name="goods_id" value="{{$_GET['goods_id']}}">
<table border="1" width="100%">
	<tr>
		{{foreach from="$attr" value="$v"}}
		<td width="60">
			<select name="attr[{{$v['attr_id']}}][]">
			{{foreach from="$goodsAttr" value="$a"}}
				{{if value="$a['attr_id']==$v['attr_id']"}}
				<option value="{{$a['good_attr_id']}}">{{$a['attr_value']}}</option>
				{{endif}}
			{{endforeach}}
			</select>
		</td>
		{{endforeach}}
		<td  width="180">
			<input type="text" name="product_sn[]">
		</td>
		<td width="180">
			<input type="number" name="product_number[]">
		</td>
		<td width="80">
			<a href="javascript:;" onclick="addProduct(this)">[+]</a>
		</td>
	</tr>
</table>
<input type="submit" value="保存" class="hd-btn hd-btn-primary">
</form>
</body>
</html>









